package org.devf.fork.imsimulator.socket.dto;


import cn.hutool.core.util.IdUtil;

import java.io.Serializable;

public class BasePackets implements Serializable {
    private static final long serialVersionUID = -1518400431884383264L;

    private Long id;

    /**
     * 是否是应答包，0,1
     */
    private Integer isNeedAck;
    /**
     * 数据ID
     */
    private String packageId;
    /**
     * 业务类型
     * @see BizType
     */
    private String bizType;
    /**
     * 是否是ACK消息
     */
    private Boolean ack;
    /**
     * 消息状态
     * @see MsgStatus
     */
    private Integer msgStatus;
    /**
     * 数据包发送者ID
     *
     * 设备唯一编码&userId
     */
    private String fromDeviceId;
    /**
     * 数据包目标ID
     * 几种编码：
     * => 默认：设备唯一编码&userId
     * => 单聊的话：关系ID
     * => 群聊的话：群ID
     */
    private String destDeviceId;
    /**
     * 关系 ID
     */
    private long chatSessionId;
    /**
     * 数据包生成时间
     */
    private String createTime;
    /**
     * 数据包实际内容
     */
    private Object contents;


    public BasePackets() {
        createTime = System.currentTimeMillis()+"";
        contents = new MsgContents();
        this.setPackageId(IdUtil.getSnowflakeNextIdStr());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getIsNeedAck() {
        return isNeedAck;
    }

    public void setIsNeedAck(Integer isNeedAck) {
        this.isNeedAck = isNeedAck;
    }

    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public Boolean getAck() {
        return ack;
    }

    public void setAck(Boolean ack) {
        this.ack = ack;
    }

    public Integer getMsgStatus() {
        return msgStatus;
    }

    public void setMsgStatus(Integer msgStatus) {
        this.msgStatus = msgStatus;
    }

    public String getFromDeviceId() {
        return fromDeviceId;
    }

    public void setFromDeviceId(String fromDeviceId) {
        this.fromDeviceId = fromDeviceId;
    }

    public String getDestDeviceId() {
        return destDeviceId;
    }

    public void setDestDeviceId(String destDeviceId) {
        this.destDeviceId = destDeviceId;
    }

    public long getChatSessionId() {
        return chatSessionId;
    }

    public void setChatSessionId(long chatSessionId) {
        this.chatSessionId = chatSessionId;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Object getContents() {
        return contents;
    }

    public void setContents(Object contents) {
        this.contents = contents;
    }
}
